﻿<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>测试容器</title>
        <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
        <script src="../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
        <script src="../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
        <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
        <script src="../../Scripts/config.js" type="text/javascript"></script>
        <script src="../../Comm/Gener.js" type="text/javascript"></script>
        <script language="javascript" type="text/javascript">

            //window.onunload = onclose;
            //function onclose() {
            //    LetAdminerLogin();
            //}
           
            //关闭页面登录admin
            $(window).on('beforeunload', function () {
                //console.log("关闭窗口123");
                LetAdminerLogin();
              //  return "您已经安全退出了。";

            });

            /*// 当前页面失去焦点登录admin
            window.onblur  = function () {
                var adminer = GetQueryString("Adminer"); //管理员.
                var sid = GetQueryString("AdminerSID"); //管理员SID.
                //访问后台，管理员登录.
                var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_TestingContainer");
                handler.AddUrlData();
                var data = handler.DoMethodReturnString("Default_LetAdminerLogin");
            }*/
            //获得参数.
            var flowNo = this.GetQueryString("FK_Flow");
            
            var flow = new Entity("BP.WF.Flow", flowNo);
            document.title = "测试容器:" + flow.Name;

            var adminer = GetQueryString("Adminer"); //管理员.
            var adminerSID = GetQueryString("AdminerSID"); //管理员SID.
            var userNo = GetQueryString("UserNo"); //要登录的用户

            //访问后台，获得一个工作ID.
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_TestingContainer");
            handler.AddUrlData();
            var workID = handler.DoMethodReturnString("Default_Init");
            var urlEnd = "&FK_Flow=" + flowNo + "&WorkID=" + workID + "&UserNo=" + userNo + "&Adminer=" + adminer + "&AdminerSID=" + adminerSID;

            //负责人：@qfl
            $(function () {
                document.getElementById("left").src = "Left.html?1=2" + urlEnd;
                document.getElementById("right").src = "../../MyFlow.htm?FK_Flow=" + flowNo + "&WorkID=" + workID;
            });
            // 发送成功后刷新页面进入切换用户页面
            function refreshRight() {
                
                 document.getElementById("right").src = "SelectOneUser.html?1=2" + urlEnd;
            }
            // 切换用户后刷新左侧
             function refreshLeft() {
                  document.getElementById("left").src = "Left.html?1=2" + urlEnd;
            }
            //如果关闭的时候，就让admin登录.
            function LetAdminerLogin() {
                var adminer = GetQueryString("Adminer"); //管理员.
                var sid = GetQueryString("AdminerSID"); //管理员SID.

                //访问后台，获得一个工作ID.
                var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_TestingContainer");
                handler.AddUrlData();
                
                var data = handler.DoMethodReturnString("Default_LetAdminerLogin");
                
            }
        </script>

    </head>
    
        <frameset cols="10%,90%">
            <frame name="left" id="left" src="Left.html" />
            <frame name="right" id="right" src="Welcome.html" />
        </frameset>
</html>
